Inspection score distribution by borough
nyc_inspections_cleaned |>
mutate(boro = fct_reorder(boro, score)) |>
plot_ly(y = ~score, color = ~boro, type = "box", colors = "viridis")
## Warning: There were 3 warnings in `mutate()`.
## The first warning was:
## ℹ In argument: `boro = fct_reorder(boro, score)`.
## Caused by warning:
## ! `fct_reorder()` removing 18 missing values.
## ℹ Use `.na_rm = TRUE` to silence this message.
## ℹ Use `.na_rm = FALSE` to preserve NAs.
## ℹ Run `dplyr::last_dplyr_warnings()` to see the 2 remaining
## warnings.
## Warning: Ignoring 18 observations
Cuisine type distribution
nyc_inspections_cleaned |>
count(cuisine_description) |>
mutate(cuisine_description = fct_reorder(cuisine_description, n)) |>
plot_ly(x = ~cuisine_description, y = ~n, color = ~cuisine_description, type = "bar", colors = "viridis")